import request from "@/utils/request";

// 获取企业的部门列表接口
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 删除部门接口
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 新增部门接口
export function addDepartment(data) {
  return request({
    url: "/company/department",
    method: "post",
    data
  })
}

// 获得部门详情信息的接口
export function getDeptDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 修改部门详情接口
export function editDept(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
